//package cn.xspace.wnx.fragment;
//
//import android.graphics.Color;
//import android.graphics.drawable.ColorDrawable;
//import android.os.Bundle;
//import android.view.LayoutInflater;
//import android.view.View;
//import android.widget.LinearLayout;
//import android.widget.RelativeLayout;
//import android.widget.TextView;
//
//import com.xspace.android.xafcommon.base.BaseFragment;
//import com.xspace.android.xafcommon.been.BaseReturnBean;
//import com.xspace.android.xafcommon.util.Constants;
//import com.xspace.android.xafcommon.util.LogUtil;
//import cn.xspace.library.util.MyInfoUtil;
//import cn.xspace.library.util.OkHttpManager;
//import com.xspace.android.xafcommon.view.MyGridView;
//
//import org.json.JSONException;
//import org.json.JSONObject;
//
//import java.util.ArrayList;
//import java.util.HashMap;
//import java.util.Map;
//
//import cn.xspace.wnx.R;
//import cn.xspace.wnx.activity.ChatInfoActivity;
//import cn.xspace.wnx.adapter.HeadAdapter;
//import cn.xspace.library.bean.OrgDeptUserBean;
//import cn.xspace.wnx.view.switchbutton.SwitchButton;
//import rx.android.schedulers.AndroidSchedulers;
//import rx.functions.Action1;
//import rx.schedulers.Schedulers;
//
///**
// * Wubj 创建于 2016/12/26 0026.
// */
//public class PersonChatInfoFragment extends BaseFragment implements View.OnClickListener {
//
//    private static final String TAG = PersonChatInfoFragment.class.getSimpleName();
//
//    private String senderId;
//    private String userId;
//    private String myOrgId;
//
//    private MyGridView mGridview;
//    private LinearLayout mLinear_group_visible_top;
//    private LinearLayout mLinear_group_visible_bottom;
//    private RelativeLayout mRelative_look_chat_record;
//    private RelativeLayout mRelative_chat_clear;
//    private RelativeLayout mRelative_chat_delt;
//    private TextView mTxt_chat_delete;
//
//    private SwitchButton mMessage_disturb_switch;
//    private SwitchButton mChat_top_switch;
//
//    private TextView mTxt_group_num;
//    private TextView mTxt_group_name;
//    private TextView mTxt_belong_org;
//    private RelativeLayout mRelative_message_disturb;
//    private RelativeLayout mRelative_group_num;
//    private RelativeLayout mRelative_group_name;
//    private RelativeLayout mRelative_chat_top;
//    private RelativeLayout mRelative_owner_turn;
//
//    private ArrayList<OrgDeptUserBean> userList;
//    private ArrayList<OrgDeptUserBean> userRealList;
//    private HeadAdapter headAdapter;
//    //是否本机构人员
//    private boolean isOurOrgMember;
//
//    public static PersonChatInfoFragment newInstance(Bundle bundle) {
//        PersonChatInfoFragment fragment = new PersonChatInfoFragment();
//        fragment.setArguments(bundle);
//        return fragment;
//    }
//
//    @Override
//    protected void getIntentData() {
//        super.getIntentData();
//        if (fragmentArgs != null) {
//            senderId = fragmentArgs.getString(ChatInfoActivity.SENDER_ID);
//        }
//        userId = MyInfoUtil.getMyUserid(mContext);
//        myOrgId = MyInfoUtil.getMyDeptId(mContext);
//    }
//
//    @Override
//    public View initView(LayoutInflater inflater) {
//        return inflater.inflate(R.layout.fragment_chat_info, null, false);
//    }
//
//    @Override
//    protected void initFindViewById(View view) {
//        //非群组,不显示
//        mLinear_group_visible_top = (LinearLayout) view.findViewById(R.id.linear_group_visible_top);
//        mLinear_group_visible_bottom = (LinearLayout) view.findViewById(R.id.linear_group_visible_bottom);
//        mLinear_group_visible_top.setVisibility(View.GONE);
//        mLinear_group_visible_bottom.setVisibility(View.GONE);
//
//        mRelative_message_disturb = (RelativeLayout) view.findViewById(R.id.relative_message_disturb);
//        mMessage_disturb_switch = (SwitchButton) view.findViewById(R.id.message_disturb_switch);
//
//        mRelative_chat_top = (RelativeLayout) view.findViewById(R.id.relative_chat_top);
//        mChat_top_switch = (SwitchButton) view.findViewById(R.id.chat_top_switch);
//
//        mRelative_look_chat_record = (RelativeLayout) view.findViewById(R.id.relative_look_chat_record);
//        mRelative_chat_clear = (RelativeLayout) view.findViewById(R.id.relative_chat_clear);
//
//        mRelative_chat_delt = (RelativeLayout) view.findViewById(R.id.relative_chat_delt);
//        mTxt_chat_delete = (TextView) view.findViewById(R.id.tv_chat_delete);
//        mTxt_chat_delete.setText(R.string.txt_chat_delet);
//
//        mGridview = (MyGridView) view.findViewById(R.id.gridview);
//    }
//
//    @Override
//    public void initData() {
//        userList = new ArrayList<>();
//        userRealList = new ArrayList<>();
//        headAdapter = new HeadAdapter(mContext, userList);
//        mGridview.setAdapter(headAdapter);
//        showWaitDialog();
//        Map<String, Object> dataMap = new HashMap<>();
//        dataMap.put("user_id", userId);
//        dataMap.put("org_id", myOrgId);
//        dataMap.put("member_id", senderId);
//        //单聊就先获取查询是否是本机构人员
//        registerSubscription(OkHttpManager.getInstance().commonRequest(Constants.CHECK_USER_EXIST_BYORG, dataMap)
//                .observeOn(Schedulers.io())
//                .subscribeOn(AndroidSchedulers.mainThread())
//                .subscribe(new Action1<BaseReturnBean>() {
//                    @Override
//                    public void call(BaseReturnBean baseReturnBean) {
//                        LogUtil.d(TAG, "wubaojie>>>call: baseReturnBean.data : " + baseReturnBean.data);
//                        try {
//                            JSONObject jsonObject = new JSONObject(baseReturnBean.data);
//                            int result = jsonObject.optInt("result");
//                            isOurOrgMember = result == 1;//1:存在 0:不存在
//                        } catch (JSONException e) {
//                            e.printStackTrace();
//                        }
////                            try {
////                                JSONObject jsonObject = new JSONObject(baseReturnBean.data);
////                                sender_orgId = jsonObject.optString("user_orgid");
////                            } catch (JSONException e) {
////                                e.printStackTrace();
////                            }
//                    }
//                }));
//    }
//
//    @Override
//    protected void initEvent() {
//        mRelative_look_chat_record.setOnClickListener(this);
//        mRelative_chat_delt.setOnClickListener(this);
//        mRelative_chat_clear.setOnClickListener(this);
//        mGridview.setSelector(new ColorDrawable(Color.TRANSPARENT));
//
//    }
//
//    @Override
//    public void onClick(View v) {
//
//    }
//}
